home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2417 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  61 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: mozart.unx.sas.com!jamie
  3. From: jamie@cdevil.unx.sas.com (James Cooper)
  4. Subject: Re: C compiler problem
  5. Originator: jamie@cdevil.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <DLzwG3.MDA@unx.sas.com>
  8. Date: Tue, 30 Jan 1996 13:07:15 GMT
  9. X-Nntp-Posting-Host: cdevil.unx.sas.com
  10. References:  <4ek3b2$a5k@nntp.novia.net>
  11. Organization: SAS Institute Inc.
  12.  
  13.  
  14. In article <4ek3b2$a5k@nntp.novia.net>, tsyslo@oasis.novia.net (Tony Syslo) writes:
  15. >I have a friend who is converting a CNET BBS game from ARREX to C.
  16. >Here is his request:
  17. >
  18. >Can anyone tell me why this program is not compiling?
  19. >I am using SAS/C 6.50, and am getting a BPTR error on line 35 with the
  20. >"struct FileHandle *".
  21. >
  22. >PROGRAM START:
  23. >
  24. >  struct FileHandle *file_handle;
  25.  
  26. That's an easy one, which people are *still* having problems with, even
  27. after 10 years... is anyone actually reading the docs (RKM, etc.)?
  28.  
  29. The dos.library calls (Open, Seek, Write, etc.) do ***NOT*** return or
  30. use a
  31.  
  32.         "struct FileHandle *"
  33.  
  34. they need a
  35.  
  36.         "BPTR"
  37.  
  38. The error message is exactly correct.  The prototypes for these functions
  39. in the header file <clib/dos_protos.h> CORRECTLY list the types as BPTR,
  40. but your friend is attempting to use "struct FileHandle *" instead.
  41.  
  42. If he changes the above declaration to
  43.  
  44.    BPTR file_handle;
  45.  
  46. and removes all casts to (struct FileHandle *), the problem will be fixed.
  47.  
  48. Now, indeed, if that BPTR is turned into a C pointer, it will point to a
  49. "struct FileHandle", but there's nothing in there that anyone should be
  50. messing with, anyway.
  51.  
  52. -- 
  53. ---------------
  54. Jim Cooper
  55. (jamie@unx.sas.com)                             bix: jcooper
  56.  
  57. Any opinions expressed herein are mine (Mine, all mine!  Ha, ha, ha!),
  58. and not necessarily those of my employer.
  59.  
  60. I'm NOT Politically Correct, but that's because I'm "Sensitivity Challenged."
  61.